Skip to content

GraphClient and GraphRequestAdapter#555

Merged
ramsessanchez merged 14 commits intov3/longTermBranchfrom
v3/IbaseClientFlow
Jul 19, 2022
Merged

GraphClient and GraphRequestAdapter#555
ramsessanchez merged 14 commits intov3/longTermBranchfrom
v3/IbaseClientFlow

Conversation

@ramsessanchez
Copy link
Copy Markdown
Contributor

@ramsessanchez ramsessanchez commented Jun 23, 2022

Fixes #533 #537

GraphClientFactory
BaseGraphRequestAdapter

@ramsessanchez ramsessanchez requested a review from baywet June 30, 2022 01:59
@ramsessanchez
Copy link
Copy Markdown
Contributor Author

Spotbugs failing, this is expected.

@ramsessanchez
Copy link
Copy Markdown
Contributor Author

Added finalized constructors for baseClient and baseGraphRequestAdapter with following param patterns:
Auth
Auth, URL // Auth, Cloud, Version
Auth, Client, Options, Url // Auth, Client, Options, Cloud, Version
Auth, Client, Options

@ramsessanchez ramsessanchez requested a review from baywet July 13, 2022 23:02
/**
* Default client implementation.
*/
public class BaseClient implements IBaseClient{
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe we can have a base client (class) in core anymore.
That's because the GeneratedGraphServiceClient will be a class that doesn't inherit from this one and Java doesn't support multiple inheritance.
So this will either have to move to the service library and inherit from the generated client or be removed all together.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Vincent, it seems that in C# there is this baseClient class as a means to create a lightweight client that doesn't rely on the service library. I believe we can keep this class here as GraphServiceClient will extend from BaseGraphServiceClient and implement IBaseClient. This is the same pattern that we have in C#. This means I will have to create the GraphServiceClient following the same pattern that is already in C#, but I believe we can keep both.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alright, but just to be clear, this one won't be in the inheritance structure of a client for somebody using the graph service client from the service lib, correct?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, the the GraphServiceClient will extend the BaseGraphServiceClient and implement IBaseClient, GraphServiceClient will not use any BaseClient implementations.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so should this class be removed from the PR?

This was linked to issues Jul 14, 2022
@ramsessanchez ramsessanchez merged commit ee5d994 into v3/longTermBranch Jul 19, 2022
@ramsessanchez ramsessanchez deleted the v3/IbaseClientFlow branch July 19, 2022 18:47
Comment on lines +144 to +169
customizePom(pom)
groupId project.property('mavenGroupId')
artifactId project.property('mavenArtifactId')
version "${mavenMajorVersion}.${mavenMinorVersion}.${mavenPatchVersion}${mavenCentralSnapshotArtifactSuffix}"
from components.java
pom.withXml {
def pomFile = file("${project.buildDir}/generated-pom.xml")
writeTo(pomFile)
}
artifact sourceJar
artifact javadocJar
}

mavenCentralRelease(MavenPublication) {
customizePom(pom)
groupId project.property('mavenGroupId')
artifactId project.property('mavenArtifactId')
version "${mavenMajorVersion}.${mavenMinorVersion}.${mavenPatchVersion}"
from components.java
pom.withXml {
def pomFile = file("${project.buildDir}/generated-pom.xml")
writeTo(pomFile)
}
artifact sourceJar
artifact javadocJar
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor issue: @ramsessanchez @baywet We can consider configuring a deterministic code formatter to avoid diff due to indenting and prevent merging code that's not formatted al together.

I've worked with spotless which can be configured to check PR's and can be used a maven / gradle plugin. For the formatting rules we can use a derivative of google-formatter

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go for it! I usually rely on editor config, but as long as it works on vs code I'm happy. Don't hesitate to pr microsoft/kiota-java (no need to PR the service libs)

@ramsessanchez ramsessanchez linked an issue Jul 21, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GraphClientFactory creation IBaseClient refactor BaseRequest change to RequestAdapter

3 participants